var loadingCount = 0
var loading = null

export function loading_start(_this) {

  loading = _this.$loading({
    lock: true,
    text: "加载中",
    spinner: "el-icon-loading",
    background: "rgba(0, 0, 0, 0.7)",
  });

  setTimeout(() => {
    loading.close();
  }, 60000);

  loadingCount += 1;
}


export function loading_end(_this) {
  if (loadingCount > 0) {
    loadingCount -= 1;
    if (loadingCount === 0) {
      loading.close();
    }
  } else {
    loading.close();
  }
}